package com.db.user.mapper;

import com.db.user.entity.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 菜单管理 Mapper 接口
 * </p>
 *
 * @author db
 * @since 2023-10-27
 */
public interface MenuMapper extends BaseMapper<Menu> {

    @Select("SELECT name FROM qf_user_role\n" +
            "LEFT JOIN qf_role_menu ON qf_user_role.role_id = qf_role_menu.role_id\n" +
            "LEFT JOIN qf_menu ON menu_id = qf_role_menu.id\n" +
            "WHERE user_id = #{userId}")
    List<String> selectMenuNamesByUserId(String userId);

}
